[LeetCode]153. Find Minimum in Rotated Sorted Array https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/submissions/ Find Minimum in Rotated Sorted Array - 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 * 오름차순 배열을 오른쪽으로 회전시킨 배열에서의 최소값을 구하는 문제 1. left < right 일 경우 오름차순의 순으로 되어 있는 배열이므로 nums[left] 가 최소값이 된다. (left 이전의 .. 코딩테스트/LeetCode 2년 전
[LeetCode]202. Happy Number https://leetcode.com/problems/happy-number/ Happy Number - 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 * 각 자리 숫자를 제곱하여 더한 숫자가 1이 되는지 여부를 확인하는 문제 이 문제의 핵심은 어느 수에 도달했을 때 false를 return 할 것인가 라고 생각된다. -> 1을 제외한 5이하의 자연수에서는 아무리 제곱을 해도 1이 도출 될 수 없다. class Solution { static boolean an.. 코딩테스트/LeetCode 2년 전