Open in app

Sign In

Write

Sign In

Fatboy Slim
Fatboy Slim

103 Followers

Home

About

Dec 12, 2022

[LeetCode]#2500. Delete Greatest Value in Each Row

Environment: Python 3.8 Key technique: for, max You are given an m x n matrix grid consisting of positive integers. Perform the following operation until grid becomes empty: Delete the element with the greatest value from each row. If multiple such elements exist, delete any of them. Add the maximum…

Python

2 min read

[LeetCode]#2500. Delete Greatest Value in Each Row
[LeetCode]#2500. Delete Greatest Value in Each Row
Python

2 min read


Dec 2, 2022

[LeetCode]#2418. Sort the People

Environment: Python 3.8 Key technique: zip, sorted You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n. For each index i, names[i] and heights[i] denote the name and height of the ith person. Return names sorted in descending order by the people's heights. Example 1: Input: names = ["Mary","John","Emma"], heights = [180,165,170] Output: ["Mary","Emma","John"] Explanation: Mary is the tallest, followed by Emma and John.

Leetcode

1 min read

[LeetCode]#2418. Sort the People
[LeetCode]#2418. Sort the People
Leetcode

1 min read


Nov 28, 2022

[LeetCode]#2220. Minimum Bit Flips to Convert Number

Environment: Python 3.8 Key technique: XOR, count A bit flip of a number x is choosing a bit in the binary representation of x and flipping it from either 0 to 1 or 1 to 0. For example, for x = 7, the binary representation is 111 and we may…

Leetcode

2 min read

[LeetCode]#2220. Minimum Bit Flips to Convert Number
[LeetCode]#2220. Minimum Bit Flips to Convert Number
Leetcode

2 min read


Nov 24, 2022

[LeetCode]#2315. Count Asterisks

Environment: Python 3.8 Key technique: split You are given a string s, where every two consecutive vertical bars '|' are grouped into a pair. In other words, the 1st and 2nd '|' make a pair, the 3rd and 4th '|' make a pair, and so forth. Return the number of…

Leetcode

1 min read

[LeetCode]#2315. Count Asterisks
[LeetCode]#2315. Count Asterisks
Leetcode

1 min read


Nov 22, 2022

[LeetCode]#2367. Number of Arithmetic Triplets

Environment: Python 3.8 Key technique: in You are given a 0-indexed, strictly increasing integer array nums and a positive integer diff. A triplet (i, j, k) is an arithmetic triplet if the following conditions are met: i < j < k, nums[j] - nums[i] == diff, and nums[k] - nums[j] == diff. Return the number of unique arithmetic triplets. Example 1: Input: nums = [0,1,4,6,7,10], diff = 3 Output: 2 Explanation: (1, 2, 4) is an arithmetic triplet because both 7 - 4 == 3 and 4 - 1 == 3. (2, 4, 5) is an arithmetic triplet because both 10 - 7 == 3 and 7 - 4 == 3.

Leetcode

1 min read

[LeetCode]#2367. Number of Arithmetic Triplets
[LeetCode]#2367. Number of Arithmetic Triplets
Leetcode

1 min read


Nov 21, 2022

[LeetCode]#2325. Decode the Message

Environment: Python 3.8 Key technique: chain You are given an n x n integer matrix grid. Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that: maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row…

Leetcode

2 min read

[LeetCode]#2325. Decode the Message
[LeetCode]#2325. Decode the Message
Leetcode

2 min read


Nov 18, 2022

[LeetCode]#2325. Decode the Message

Environment: Python 3.8 Key technique: chr, dictionary You are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows: Use the first appearance of all 26 lowercase English letters in key as the order of the…

Python

2 min read

[LeetCode]#2325. Decode the Message
[LeetCode]#2325. Decode the Message
Python

2 min read


Nov 16, 2022

[LeetCode]#2469. Convert the Temperature

Environment: Python 3.8 Key technique: none You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius. You should convert Celsius into Kelvin and Fahrenheit and return it as an array ans = [kelvin, fahrenheit]. Return the array ans. Answers within 10-5 of the actual answer will be accepted. Note that: Kelvin = Celsius + 273.15

Python

1 min read

[LeetCode]#2469. Convert the Temperature
[LeetCode]#2469. Convert the Temperature
Python

1 min read


Nov 8, 2022

[LeetCode]#2194. Cells in a Range on an Excel Sheet

Environment: Python 3.8 Key technique: chr, ord, for A cell (r, c) of an excel sheet is represented as a string "<col><row>" where: <col> denotes the column number c of the cell. It is represented by alphabetical letters. For example, the 1st column is denoted by 'A', the 2nd by…

Leetcode

2 min read

[LeetCode]#2194. Cells in a Range on an Excel Sheet
[LeetCode]#2194. Cells in a Range on an Excel Sheet
Leetcode

2 min read


Nov 4, 2022

[LeetCode]#2236. Root Equals Sum of Children

Environment: Python 3.8 Key technique: tree node You are given the root of a binary tree that consists of exactly 3 nodes: the root, its left child, and its right child. Return true if the value of the root is equal to the sum of the values of its two…

Leetcode

2 min read

[LeetCode]#2236. Root Equals Sum of Children
[LeetCode]#2236. Root Equals Sum of Children
Leetcode

2 min read

Fatboy Slim

Fatboy Slim

103 Followers

Interesting in any computer science.

Following
  • Wombat Exchange

    Wombat Exchange

  • Wis

    Wis

  • The XREX team

    The XREX team

  • Will Kuo

    Will Kuo

  • Alvin Hung

    Alvin Hung

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech