본문 바로가기

전체 글1658

[LeetCode] 860. Lemonade Change - Java • 문제 링크 Lemonade Change - LeetCodeCan you solve this real interview question? Lemonade Change - At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonadeleetcode.com • 풀이 코드public class Solution { public boolean lemonadeChange(int[] bills) { int f = 0.. 2026. 10. 27.
[LeetCode] 859. Buddy Strings - Java • 문제 링크 Buddy Strings - LeetCodeCan you solve this real interview question? Buddy Strings - Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false. Swapping letters is defined as taking two indices i and j (0-indleetcode.com • 풀이 코드public class Solution { public boolean buddyStrings(String s, String goal) { int.. 2026. 10. 26.
[LeetCode] 844. Backspace String Compare - Java • 문제 링크 Backspace String Compare - LeetCodeCan you solve this real interview question? Backspace String Compare - Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character. Note that after backspacing an empty text, the texleetcode.com • 풀이 코드public class Solution { public boolean backspaceCompare(String s, String t) .. 2026. 10. 25.
[LeetCode] 836. Rectangle Overlap - Java • 문제 링크 Rectangle Overlap - LeetCodeCan you solve this real interview question? Rectangle Overlap - An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its topleetcode.com • 풀이 코드public class Solution { public boolean isRectangleOverlap(int[] rec1, int[] rec2) {.. 2026. 10. 24.
[LeetCode] 832. Flipping an Image - Java • 문제 링크 Flipping an Image - LeetCodeCan you solve this real interview question? Flipping an Image - Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means that each row of the image is reversed. * Fleetcode.com • 풀이 코드public class Solution { public int[][] flipAndInvertImage(int[][] image) { i.. 2026. 10. 23.
[LeetCode] 830. Positions of Large Groups - Java • 문제 링크 Positions of Large Groups - LeetCodeCan you solve this real interview question? Positions of Large Groups - In a string s of lowercase letters, these letters form consecutive groups of the same character. For example, a string like s = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z", andleetcode.com • 풀이 코드import java.util.ArrayList;import java.util.List;public class Solution { pub.. 2026. 10. 23.