본문 바로가기

전체 글1646

[LeetCode] 796. Rotate String - Java • 문제 링크 Rotate String - LeetCodeCan you solve this real interview question? Rotate String - Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the rightmost position.leetcode.com • 풀이 코드public class Solution { public boolean rotateString(String s, String goal) { retu.. 2026. 10. 15.
[LeetCode] 783. Minimum Distance Between BST Nodes - Java • 문제 링크 Minimum Distance Between BST Nodes - LeetCodeCan you solve this real interview question? Minimum Distance Between BST Nodes - Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree. Example 1: [https://assets.leetcode.cleetcode.com • 풀이 코드public class Solution { private int min = Integer.MAX_VALUE, prev =.. 2026. 10. 14.
[LeetCode] 771. Jewels and Stones - Java • 문제 링크 Jewels and Stones - LeetCodeCan you solve this real interview question? Jewels and Stones - You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to knoleetcode.com • 풀이 코드public class Solution { public int numJewelsInStones(String jewels, String stones) .. 2026. 10. 13.
[LeetCode] 766. Toeplitz Matrix - Java • 문제 링크 Toeplitz Matrix - LeetCodeCan you solve this real interview question? Toeplitz Matrix - Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false. A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements. Example 1:leetcode.com • 풀이 코드public class Solution { public boolean isToeplitzMatrix(int[][] matrix) { int r =.. 2026. 10. 12.
[LeetCode] 762. Prime Number of Set Bits in Binary Representation - Java • 문제 링크 Prime Number of Set Bits in Binary Representation - LeetCodeCan you solve this real interview question? Prime Number of Set Bits in Binary Representation - Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary representaleetcode.com • 풀이 코드public class Solution { public int countPrimeSetBit.. 2026. 10. 11.
[LeetCode] 748. Shortest Completing Word - Java • 문제 링크 Shortest Completing Word - LeetCodeCan you solve this real interview question? Shortest Completing Word - Given a string licensePlate and an array of strings words, find the shortest completing word in words. A completing word is a word that contains all the letters in licensePlate. Ignoreleetcode.com • 풀이 코드public class Solution { public String shortestCompletingWord(String licensePl.. 2026. 10. 10.