IT/알고리즘90 22] Leetcode 1446. Consecutive Characters Consecutive Characters - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문자열이 주어지고 그 문자열내에서 한 알파벳으로만 이뤄진 부분 문자열의 최대 길이를 반환하는 문제. class Solution { public: int maxPower(string s) { int ans = 1; int startPoint = 0; char startChar= s[0]; for(int i = 1;i 2020. 7. 3. 21] Leetcode 657. Robot Return to Origin Robot Return to Origin - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 주어진 문자열대로 이동했을때 원래 위치로 돌아올 수 있는지 묻는 문제. class Solution { public: bool judgeCircle(string moves) { int upDown = 0; int leftRight =0; for(int i = 0;i 2020. 7. 1. 20] Leetcode 1450. Number of Students Doing Homework at a Given Time Number of Students Doing Homework at a Given Time - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 고대로 해주면 된다. class Solution { public: int busyStudent(vector& startTime, vector& endTime, int queryTime) { int ans =0; for(int i = 0;i 2020. 7. 1. 19★] Leetcode 1436. Destination City 최종 목적지를 반환하는 문제. Destination City - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 양 끝점만 한번 나오고 나머지 city는 두 번씩 나오니까 한 번만 나오는 city 중에 목적지에 있는 city를 반환하는 문제. class Solution { public: string destCity(vector& paths) { // 한번나오고 뒤에 배치되어있는 문자열 반환 map words; map::iterator it; for(int i = .. 2020. 6. 30. 이전 1 ··· 15 16 17 18 19 20 21 ··· 23 다음