LeetCode41 [LeetCode] 135. Candy 문제 URL : https://leetcode.com/problems/candy/description/ Candy - LeetCode Can you solve this real interview question? Candy - There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: * Each leetcode.com 문제 접근법 : 아이들에게 사탕을나눠주는 문제입니다. 모든아이들은 최소 1개이상은 받아야하고 아이.. 2023. 8. 26. [LeetCode] 115. Distinct Subsequences 문제 URL : https://leetcode.com/problems/distinct-subsequences/description/ Distinct Subsequences - LeetCode Can you solve this real interview question? Distinct Subsequences - Given two strings s and t, return the number of distinct subsequences of s which equals t. The test cases are generated so that the answer fits on a 32-bit signed integer. Example 1: In leetcode.com 문제 접근법 : s의 부분 문자열중에서 t가.. 2023. 8. 26. LeetCode Valid Sudoku 문제 URL : https://leetcode.com/problems/valid-sudoku/description/ Valid Sudoku - LeetCode Can you solve this real interview question? Valid Sudoku - Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: 1. Each row must contain the digits 1-9 without repetition. 2. Each c leetcode.com 문제접근법 : 스도쿠 문제입니다. 미완성 스도쿠이지만 주어진 숫자가 주어질때 완성되.. 2023. 6. 16. LeetCode 문제 URL : https://leetcode.com/problems/maximum-product-subarray/description/ Maximum Product Subarray - 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 문제 접근법 : 연속적으로 곱해보고 0이면 다시 곱할수있도록 1로바꿔주면됩니다. 물론 앞에서 곱했을때와 뒤에서 곱했을때 , 둘중 최대값을 반환하면 되는 문제이기에 쉽게 이해할수있습니다. 소스코드 : #include using name.. 2022. 11. 11. 이전 1 ··· 4 5 6 7 8 9 10 11 다음