본문 바로가기

전체 글1640

[LeetCode] 747. Largest Number At Least Twice of Others - Java • 문제 링크 Largest Number At Least Twice of Others - LeetCodeCan you solve this real interview question? Largest Number At Least Twice of Others - You are given an integer array nums where the largest integer is unique. Determine whether the largest element in the array is at least twice as much as every other numbeleetcode.com • 풀이 코드public class Solution { public int dominantIndex(int[] nums) .. 2026. 10. 9.
[LeetCode] 746. Min Cost Climbing Stairs - Java • 문제 링크 Min Cost Climbing Stairs - LeetCodeCan you solve this real interview question? Min Cost Climbing Stairs - You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps. You can either start from the steleetcode.com • 풀이 코드public class Solution { public int minCostClimbingStairs(int[] cost) { .. 2026. 10. 8.
[LeetCode] 744. Find Smallest Letter Greater Than Target - Java • 문제 링크 Find Smallest Letter Greater Than Target - LeetCodeCan you solve this real interview question? Find Smallest Letter Greater Than Target - You are given an array of characters letters that is sorted in non-decreasing order, and a character target. There are at least two different characters in letters. Retuleetcode.com • 풀이 코드public class Solution { public char nextGreatestLetter(char[.. 2026. 10. 7.
[LeetCode] 733. Flood Fill - Java • 문제 링크 Flood Fill - LeetCodeCan you solve this real interview question? Flood Fill - You are given an image represented by an m x n grid of integers image, where image[i][j] represents the pixel value of the image. You are also given three integers sr, sc, and color. Your task is toleetcode.com • 풀이 코드public class Solution { public int[][] floodFill(int[][] image, int sr, int sc, int color) .. 2026. 10. 6.
[LeetCode] 728. Self Dividing Numbers - Java • 문제 링크 Self Dividing Numbers - LeetCodeCan you solve this real interview question? Self Dividing Numbers - A self-dividing number is a number that is divisible by every digit it contains. * For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. A self-dleetcode.com • 풀이 코드import java.util.ArrayList;import java.util.List;public class Solution { public.. 2026. 10. 5.
[LeetCode] 724. Find Pivot Index - Java • 문제 링크 Find Pivot Index - LeetCodeCan you solve this real interview question? Find Pivot Index - Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum ofleetcode.com • 풀이 코드public class Solution { public int pivotIndex(int[] nums) { int l = 0, r = 0; .. 2026. 10. 4.