[LeetCode/Kotlin]Easy - 28. Find the Index of the First Occurrence in a String
·
LeetCode/Kotlin | Easy
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..
[LeetCode/Kotlin]Easy - 219. Contains Duplicate II
·
LeetCode/Kotlin | Easy
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)
[LeetCode/Kotlin]Easy - 136. Single Number
·
LeetCode/Kotlin | Easy
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..
[LeetCode/Kotlin]Easy - 169. Majority Element
·
LeetCode/Kotlin | Easy
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..
[LeetCode/Kotlin]Easy - 217. Contains Duplicate
·
LeetCode/Kotlin | Easy
문제 Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints: 1
[LeetCode/Kotlin]Easy - 66. Plus One
·
LeetCode/Kotlin | Easy
Plus One - LeetCode Can you solve this real interview question? Plus One - You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to- leetcode.com 문제 You are given a large integer represented as an integer array digits, where each digits[i] is the ith dig..
[LeetCode/Kotlin]Easy - 9. Palindrome Number
·
LeetCode/Kotlin | Easy
Palindrome Number - LeetCode Can you solve this real interview question? Palindrome Number - Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Ex leetcode.com 문제 Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 12..
[LeetCode/Kotlin]Easy - 290. Word Pattern
·
LeetCode/Kotlin | Easy
Word Pattern - LeetCode Can you solve this real interview question? Word Pattern - Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s. Example leetcode.com 문제 Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such ..
[LeetCode/Kotlin]Easy - 1470. Shuffle the Array
·
LeetCode/Kotlin | Easy
Shuffle the Array - LeetCode Can you solve this real interview question? Shuffle the Array - Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Input: nums = [2,5,1,3,4,7], n = 3 O leetcode.com 문제 Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the ..
[LeetCode/Kotlin]Easy - 14. Longest Common Prefix
·
LeetCode/Kotlin | Easy
Longest Common Prefix - LeetCode Can you solve this real interview question? Longest Common Prefix - Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow" leetcode.com 문제 Write a function to find the longest common prefix string amongst an array of strings. If there..
[LeetCode/Kotlin]Easy - 118. Pascal's Triangle
·
LeetCode/Kotlin | Easy
Pascal's Triangle - LeetCode Can you solve this real interview question? Pascal's Triangle - Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: [https://upload.wikimedia.o leetcode.com 문제 Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, e..
[LeetCode/Kotlin]Easy - 938. Range Sum of BST
·
LeetCode/Kotlin | Easy
[LeetCode/Kotlin]Easy - 938. Range Sum of BST Range Sum of BST - LeetCode Can you solve this real interview question? Range Sum of BST - Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high]. Example 1: [https://assets.l leetcode.com 문제 Given the root node of a binary search tree and two in..
[LeetCode/Kotlin]Easy - 70. Climbing Stairs
·
LeetCode/Kotlin | Easy
[LeetCode/Kotlin]Easy - 70. Climbing Stairs Climbing Stairs - LeetCode Can you solve this real interview question? Climbing Stairs - You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n = 2 Outpu leetcode.com 문제 You are climbing a staircase. It takes n steps to reach t..
[LeetCode/Kotlin]Easy - 2016. Maximum Difference Between Increasing Elements
·
LeetCode/Kotlin | Easy
[LeetCode/Kotlin]Easy - 2016. Maximum Difference Between Increasing Elements Maximum Difference Between Increasing Elements - LeetCode Can you solve this real interview question? Maximum Difference Between Increasing Elements - Given a 0-indexed integer array nums of size n, find the maximum difference between nums[i] and nums[j] (i.e., nums[j] - nums[i]), such that 0
[LeetCode/Kotlin]Easy - 404. Sum of Left Leaves
·
LeetCode/Kotlin | Easy
[LeetCode/Kotlin]Easy - 404. Sum of Left Leaves Sum of Left Leaves - LeetCode Can you solve this real interview question? Sum of Left Leaves - Given the root of a binary tree, return the sum of all left leaves. A leaf is a node with no children. A left leaf is a leaf that is the left child of another node. Example 1: [https://ass leetcode.com 문제 Given the root of a binary tree, return the sum of..
뿌꾸 빵
'LeetCode/Kotlin | Easy' 카테고리의 글 목록 (2 Page)