leetcode
9 人追踪
29 篇文章
Benjamin

[leetcode]448. Find All Numbers Disappeared in an Array

輸入的數字陣列長度為N,理想上其中應包含1~N各一個,請回傳缺少了哪些數字。

Benjamin

[leetcode]217. Contains Duplicate

判斷輸入的數字陣列是否包含重複的數字。

Benjamin

[leetcode]1003. Check If Word Is Valid After Substitutions

確認一個字串,在形成的過程是否從空字串開始,透過在字串的任意位置插入"abc"的字串而形成。

Benjamin

[leetcode]20. Valid Parentheses

輸入一個字串僅由'('、')'、'['、']'、'{'、'}'等左右括號字元組成,請寫程式判斷字串是否由合乎規則的成對括號組成。 ※:本題推薦正在學習資料結構的學生練習。

Zoka

LeetCode 2235. Add Two Integers

class Solution { public int sum(int num1, int num2) { return num1+num2; } }

Zoka

LeetCode 1672. Richest Customer Wealth (Java)

class Solution { public int maximumWealth(int[][] accounts) { int max=0; for(int[] i1: accounts){ int wealth...

Zoka

LeetCode 1342. Number of Steps to Reduce a Number to Zero (Java)

class Solution { public int numberOfSteps(int num) { int i=0; int n=num; do{ if(n%2 == 0){ ...

Zoka

LeetCode 876. Middle of the Linked List (Java)

/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNo...

Zoka

LeetCode 724. Find Pivot Index (Java)

class Solution { public int pivotIndex(int[] nums) { int sum, leftsum; sum = 0; leftsum = 0; for(int ...

Zoka

LeetCode 412. Fizz Buzz

class Solution { public List<String> fizzBuzz(int n) { ArrayList<String> al = new ArrayList<>(n); al.c...

Zoka

LeetCode 412. Fizz Buzz

class Solution { public List<String> fizzBuzz(int n) { ArrayList<String> al = new ArrayList<>(n); al.c...

Zoka

LeetCode 205. Isomorphic Strings

class Solution { public boolean isIsomorphic(String s, String t) { if(s.length()!=t.length()){ return ...

Zoka

LeetCode 9. Palindrome Number

class Solution { public boolean isPalindrome(int x) { if(x < 0 (x % 10 == 0 && x != 0)) { return false; ...

MonLes

Javascript in Leetcode 22–24 | 面試問題

目錄22. Generate Parentheses23. Merge k Sorted Lists24. Swap Nodes in Pairs找到source code Github22. Generate Parenthesesleetcode

MonLes

Javascript in Leetcode 19–21 | 面試問題

目錄19-Remove-Nth-Node-From-End-of-List17-Letter-Combinations-of-a-Phone-Number18–4Sum找source code Github19. Remove Nth Node From End of ListLeetcode

MonLes

Javascript in Leetcode 13–15|面試問題

目錄13-Roman-to-Integer14-Longest-Common-Prefix15–3Sum找到source code Github13. Roman to IntegerRoman numerals are represented by seven differe...

MonLes

Javascript in Leecode 10–12 | 面試問題

source code在此 Github10. Regular Expression MatchingGiven an input string s and a pattern p, implement regular expression matching with sup...

MonLes

Javascript in Leetcode 07–09 | 面試問題

可以來此找原始碼 my github7. Reverse IntegerGiven a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to...

MonLes

Javascript in Leetcode 04–06 | 面試問題

resource code也可以到我的github找喔 來這裡04-Median-of-Two-Sorted-ArraysMore explanation Here Leetcode 04 Problems HereGiven two sorted arrays nums1...

MonLes

Javascript in Leetcode 01–03 | 面試問題

Pheezx Coding youtube頻道 更多leetcode解釋(英文)01. Two sumInput: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] + nums...

加载中…