Open in app
Home
Notifications
Lists
Stories

Write
Quico Llinares Llorens
Quico Llinares Llorens

9 Followers

Home

Aug 31, 2020

31 days Challenge — Challenge completed!

Delete Node in a BST Problem Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion can be divided into two stages: Search for a node to remove. If the node is…

Challenge

2 min read

31 days Challenge — Challenge completed!
31 days Challenge — Challenge completed!
Challenge

2 min read


Aug 30, 2020

31 days Challenge — Day 30

Largest Component Size by Common Factor Problem Given a non-empty array of unique positive integers A, consider the following graph: There are A.length nodes, labelled A[0] to A[A.length - 1]; There is an edge between A[i] and A[j] if and only if A[i] and A[j] share a common factor greater than 1. Return the size of the largest connected component in the graph. Example 1: Input: [4,6,15,35] Output: 4

Challenge

2 min read

31 days Challenge — Day 30
31 days Challenge — Day 30
Challenge

2 min read


Aug 29, 2020

31 days Challenge — Day 29

Pancake Sorting Problem Given an array of integers A, We need to sort the array performing a series of pancake flips. In one pancake flip we do the following steps: Choose an integer k where 0 <= k < A.length. Reverse the sub-array A[0...k]. For example, if A = [3,2,1,4] and we performed…

Challenge

2 min read

31 days Challenge — Day 29
31 days Challenge — Day 29
Challenge

2 min read


Aug 28, 2020

31 days Challenge — Day 28

Implement Rand10() Using Rand7() Problem Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer in the range 1 to 10. Do NOT use system’s Math.random(). Example 1: Input: 1 Output: [7] Example 2: Input: 2 Output: [8,4] Example 3: Input: 3 Output: [8,1,10] Note: rand7 is predefined. Each testcase has one argument: n, the number of times that rand10 is called.

Challenge

2 min read

31 days Challenge — Day 28
31 days Challenge — Day 28
Challenge

2 min read


Aug 27, 2020

31 days Challenge — Day 27

Find Right Interval Problem Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the interval i, which can be called that j is on the “right” of i. For any interval i…

Challenge

2 min read

31 days Challenge — Day 27
31 days Challenge — Day 27
Challenge

2 min read


Aug 26, 2020

31 days Challenge — Day 26

Fizz Buzz Problem Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”. Example: n = 15, Return: [ "1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "13", "14", "FizzBuzz" ]

Challenge

1 min read

31 days Challenge — Day 26
31 days Challenge — Day 26
Challenge

1 min read


Aug 25, 2020

31 days Challenge — Day 25

Minimum Cost For Tickets Problem In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given as an array days. Each day is an integer from 1 to 365. Train tickets are sold in 3 different ways: a…

Challenge

2 min read

31 days Challenge — Day 25
31 days Challenge — Day 25
Challenge

2 min read


Aug 24, 2020

31 days Challenge — Day 24

Sum of Left Leaves Problem Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24. Solution Here you can see the performance of my solution (keep in mind that Runtime can vary depending on the server):

Challenge

1 min read

31 days Challenge — Day 24
31 days Challenge — Day 24
Challenge

1 min read


Aug 23, 2020

31 days Challenge — Day 23

Stream of Characters Problem Implement the StreamChecker class as follows: StreamChecker(words): Constructor, init the data structure with the given words. query(letter): returns true if and only if for some k >= 1, the last k characters queried (in order from oldest to newest, including this letter just queried) spell one of the words in…

Challenge

2 min read

31 days Challenge — Day 23
31 days Challenge — Day 23
Challenge

2 min read


Aug 22, 2020

31 days Challenge — Day 22

Random Point in Non-overlapping Rectangles Problem Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly and uniformily picks an integer point in the space covered by the rectangles. Note: An integer point is a point that has integer coordinates. A point on the perimeter of a rectangle is included in the…

Challenge

2 min read

31 days Challenge — Day 22
31 days Challenge — Day 22
Challenge

2 min read

Quico Llinares Llorens

Quico Llinares Llorens

9 Followers
Following
  • Matthew MacDonald

    Matthew MacDonald

  • Netflix Technology Blog

    Netflix Technology Blog

  • Pinterest Engineering

    Pinterest Engineering

  • Pablo Company Ramírez

    Pablo Company Ramírez

  • AirbnbEng

    AirbnbEng

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech