Solved


[Master Regular Expression] String To Integer
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. The algorithm for myAtoi(string s)...

1 month ago

Solved


[Master Regular Expression] Unique Email Addresses
Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email ma...

1 month ago

Solved


[Master Regular Expression] Reformat Phone Number
You are given a phone number as a string number. number consists of digits, spaces ' ', and/or dashes '-'. You would like to re...

1 month ago

Solved


[Master Regular Expression] Goat Latin
You are given a string sentence that consist of words separated by spaces. Each word consists of lowercase and uppercase letters...

1 month ago

Solved


Built-out FFTShift
The task in hand is to replicate the built-in function - fftshift (with single input), but without using the function. However,...

1 month ago

Solved


Breaking straight lines
Let P be a point in Oxy plane and let p be a 1×2 array representing an one-degree or zero-degree polynomials, if its first entry...

2 months ago

Solved


Hình chữ nhật lớn nhất trong biểu đồ Histogram
Cho một mảng các số nguyên heights biểu thị chiều cao của các cột trong biểu đồ tần số, trong đó chiều rộng của mỗi cột là 1, hã...

2 months ago

Solved


Jump Game
Bạn được cho một mảng số nguyên nums. Ban đầu bạn được đặt ở vị trí chỉ mục đầu tiên của mảng, và mỗi phần tử trong mảng biểu th...

2 months ago

Solved


Find nth triangular number.
Calculate the triangular number of given integer n.

2 months ago

Solved


Leo Bậc Thang
Bạn đang leo cầu thang. Cần n bước để lên đến đỉnh. Mỗi lần bạn có thể leo 1 hoặc 2 bước. Hỏi có bao nhiêu cách khác nhau để le...

2 months ago

Solved


Find record values in a sequence
Write a function to find the record values in a sequence—that is, the largest values seen since the start. For example, if the s...

2 months ago

Solved


Gather primes
A book titled Gather that I regularly see inspired this game: make as many words as possible from the letters in the word GATHER...

2 months ago

Solved


Scaling vertically parabola by evaluating its area over an interval
Let p be a quadratic polynomial, with its axis of symmetry being the y-axis. Considering the vertical shift of its vertex to the...

2 months ago

Solved


Gene Duplication with Sequencing Errors
You are investigating the genome of the bacterium Codex matlabius. A virus that infects C. matlabius is known to insert long, re...

2 months ago

Solved


[Mảng 1 Chiều Cơ Bản]. Bài 5. In phần tử
Cho mảng số nguyên A[] gồm N phần tử, nhiệm vụ của bạn là in ra các phần tử là số chẵn ở chỉ số chẵn, nếu mảng không tồn tại phầ...

2 months ago

Solved


[Mảng 1 Chiều Cơ Bản]. Bài 4. Lớn hơn, nhỏ hơn
Cho mảng số nguyên A[] gồm N phần tử và số nguyên X , hãy đếm xem trong mảng có bao nhiêu số lớn hơn X và bao nhiêu số nhỏ hơn X...

2 months ago

Solved


[Mảng 1 Chiều Cơ Bản]. Bài 3. Số nhỏ nhất
Cho mảng số nguyên A[] gồm N phần tử, hãy đếm xem trong mảng của bạn có bao nhiêu số có cùng giá trị nhỏ nhất. Ví dụ mảng A = {1...

2 months ago

Solved


[Mảng 1 Chiều Cơ Bản]. Bài 2. Trung bình cộng nguyên tố
Cho mảng số nguyên A[] gồm N phần tử, nhiệm vụ của bạn là tính trung bình cộng của các số là số nguyên tố trong dãy. Dữ liệu đảm...

2 months ago

Solved


[Mảng 1 Chiều Cơ Bản]. Bài 1. Chẵn lẻ
Cho mảng số nguyên A[] gồm N phần tử, nhiệm vụ của bạn là đếm xem trong mảng có bao nhiêu số chẵn, bao nhiêu số lẻ, tổng các phầ...

2 months ago

Solved


Scaling vertically functions
Given a real function by the 1×n array, x, of inputs and the 1×n array, y, of outputs, consider shifting vertically its graph by...

2 months ago

Solved


FEN to Chess Board
Note: This problem is the reverse, or complement, of Problem 61144 - FEN Chess Notation. Given a FEN (Forsyth-Edwards Notation)...

2 months ago

Solved


How Long is the Border Between Unitopia and Zerostan?
Two countries, Unitopia (denoted by ones) and Zerostan (denoted by zeros) are engaged in a long-standing dispute: how long is th...

2 months ago

Solved


Container With Most Water
You are given an integer array height . There are vertical lines drawn such that the two endpoints of the ith line are (i, 1) an...

2 months ago

Solved


Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You m...

2 months ago

Solved


Pascal's Pyramid - A Variation with an Arial View
Let's create a matrix of size N x N containing a Pascal's Triangle in each quadrant that diverges from the centre to form an ari...

2 months ago

Solved


Pascal's Triangle
Create a matrix of size N x N containing a Pascal's Triangle that starts from the upper left corner according to the test cases ...

2 months ago

Solved


Translating even-degree polynomial by its vertex to the origin
Let p be an even-degree polynomial such that has a unique vertex (single global extremum). Consider its translation by shifting ...

2 months ago

Solved


Convert a diagonal representation of a matrix element to linear index or subscripts
Elements in matrices in MATLAB can be retrieved by linear index or subscripts. For example, the 1 in the matrix below has a line...

2 months ago

Solved


Extract numbers using a decaying sieve
The Sieve of Eratosthenes is one method of determining primes. Starting with 2, one keeps 2 and removes 2x2, 3x2, 4x2, etc. Then...

2 months ago

Solved


Determine whether a number is a repfigit number
A sequence of numbers is constructed from a number with the following steps: List the digits of . Compute the ()st term as t...

2 months ago

Load more