전체 글(357)
-
[LeetCode/Kotlin]Easy - 1356. Sort Integers by The Number of 1 Bits
Sort Integers by The Number of 1 Bits - LeetCode Can you solve this real interview question? Sort Integers by The Number of 1 Bits - You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more integ leetcode.com 문제 You are given an integer array arr. Sort the integers in the array in ascendin..
2023.06.30 -
[LeetCode/Kotlin]Easy - 28. Find the Index of the First Occurrence in a String
Find the Index of the First Occurrence in a String - LeetCode Can you solve this real interview question? Find the Index of the First Occurrence in a String - Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: I leetcode.com 문제 Given two strings needle and haystack, return the index of the fir..
2023.06.30 -
[LeetCode/Kotlin]Easy - 219. Contains Duplicate II
Contains Duplicate II - LeetCode Can you solve this real interview question? Contains Duplicate II - Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j)
2023.06.30 -
[LeetCode/Kotlin]Easy - 136. Single Number
Single Number - LeetCode Can you solve this real interview question? Single Number - Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant leetcode.com 문제 Given a non-empty array of integers nums, every element appears twice except for one. Find that single o..
2023.06.30 -
[LeetCode/Kotlin]Easy - 169. Majority Element
Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com 문제 Given an array nums of size n, return the majority element. The majority element is the element that a..
2023.06.30 -
[프로그래머스/Kotlin]Level3 - 양과 늑대
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 문제 설명 2진 트리 모양 초원의 각 노드에 늑대와 양이 한 마리씩 놓여 있습니다. 이 초원의 루트 노드에서 출발하여 각 노드를 돌아다니며 양을 모으려 합니다. 각 노드를 방문할 때 마다 해당 노드에 있던 양과 늑대가 당신을 따라오게 됩니다. 이때, 늑대는 양을 잡아먹을 기회를 노리고 있으며, 당신이 모은 양의 수보다 늑대의 수가 같거나 더 많아지면 바로 모든 양을 잡아먹어 버립니다. 당신은 중간에 양이 늑대에게 잡아먹히지 않도록 하면서 최대한 많은 수의 양을 모아서 다시 루트 노드로 돌아오려 합니다. ..
2023.06.25