반응형

분류 전체보기 188

[Leetcode/파이썬] 236. Lowest Common Ancestor of a Binary Tree

Product of Array Except SelfGiven an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.You must write an algorithm that runs in O(n) time and without using the division operation. Example 1:Input: nums = [1,2,3,4]Output: [24,12,8,6]E..

[Leetcode/파이썬] 3. Longest Substring Without Repeating Characters

Longest Substring Without Repeating CharactersGiven a string s, find the length of the longest substring without duplicate characters. Example 1:Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3.Example 2:Input: s = "bbbbb"Output: 1Explanation: The answer is "b", with the length of 1.Example 3:Input: s = "pwwkew"Output: 3Explanation: The answer is "wke", with t..

반응형