Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
khss4008
algorithm
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
algorithm
/
Main.java
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
21 lines (17 loc) · 1011 Bytes
main
Breadcrumbs
algorithm
/
Main.java
Copy path
Top
File metadata and controls
Code
Blame
21 lines (17 loc) · 1011 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
int[] fees = {180, 5000, 10, 600};
String[] records= {"05:34 5961 IN", "06:00 0000 IN", "06:34 0000 OUT",
"07:59 5961 OUT", "07:59 0148 IN", "18:59 0000 IN", "19:09 0148 OUT",
"22:59 5961 IN", "23:00 5961 OUT"};
//split을 해서 [2]번째가 IN이면 cnt를 1씩 증가시키고 그 개수만큼 배열을 만들어주자
//그렇게 결과값을 담아줄 result 배열을 만들면(3칸) fee를 해석하자
// 180은 기본 시간 5000원은 기본 요금 10은 단위 시간(분)이고 600은 단위 요금(원)이다.
//한번 포문을 쭉 돌려서 cnt 값을 얻어온다. 그걸로 배열의 개수를 정하고,
// 그 다음 포문에서는 시간을 분으로 환산해서 OUT-IN을 해준다. 이걸 어떻게해줄것이냐 맵으로 key value 해서 넣을까?
HashMap<Integer, Integer> car = new HashMap<>();
for(int i=0; i<records.length;i++) {
}
}//main
}//class
You can’t perform that action at this time.