Filters
Taal
Niveau
Blader door onze catalogus
Ontdek leertrajecten, cursussen en projecten — alles op één plek. Leer in je eigen tempo en bouw praktijkgerichte vaardigheden op.
Maximize the Expression
Bill studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers `a`, `b`, `c` on the blackboard. The task was to insert signs of operations `+` and `*`, and probably brackets between the numbers so that the value of the resulting expression is as large as possible. Possible variants: - **a+b\*c=v1** - **a\*(b+c)=v2** - **a\*b\*c=v3** - **(a+b)\*c=v4** Note that you can insert operation signs only between `a` and `b`, and between `b` and `c`, that is, you cannot swap integers. For instance, in the given sample you cannot get expression **(a+c)\*b**. Given an integers `a`, `b` and `c`. Return **maximum value of the expression** that you can obtain.
Sort a Pair of Numbers
Given two integers `x` and `y`, return a list of integers: the first being the **minimum** of `x` and `y`, and the second being the **maximum** of `x` and `y`.
Equal Coins Distribution
Bob has three sisters: Ann, Bella, and Caroline. They're collecting coins. Currently, Ann has `a` coins, Bella has `b` coins and Caroline has `c` coins. Recently Bob has returned from the trip around the world and brought `n` coins. He wants to distribute all these `n` coins between his sisters in such a way that the number of coins Ann has is equal to the number of coins Bella has and is equal to the number of coins Caroline has. In other words, if Bob gives `A` coins to Ann, `B` coins to Bella and `C` coins to Caroline **A+B+C=n**, then **a+A=b+B=c+C** Note that `A`, `B` or `C` (the number of coins Bob gives to Ann, Bella and Caroline correspondingly) can be 0. Help Bob to find out if it is possible to distribute all `n` coins between sisters in a way described above. Given an integers `a` - the number of coins Ann has , `b` - number of coins Bella has, `c` - number of coins Caroline has and `n` - the number of coins Bob has. Return `YES` if Bob can distribute all `n` coins between his sisters and `NO` in the opposite case.
Minimum Steps to Visit a Friend
Bill decided to visit his friend. It turned out that the Bill's house is located at point 0 and his friend's house is located at point `x` **(x > 0)** of the coordinate line. In one step Bill can move `1`, `2`, `3`, `4` or `5` positions forward. Given integer `x`, return **the minimum number of steps** Bill needs to make in order to get to his friend's house.
Bob's Bus Ticket Problem
Bob has recently started commuting by bus. We know that a one bus ride ticket costs `a` dollars. Besides, Bob found out that he can buy a special ticket for `m` rides, also he can buy it several times. It costs `b` dollars. Bob will need to use bus `n` times. Help Bob to calculate what is **the minimum sum of money** he will have to spend to make `n` rides?
Identify the Distinct Number
Given three digits `a`, `b`, `c`, where two of them are equal and one is different, return the value that occurs exactly once.
One Flip Game
Bob likes to play his game on paper. He writes `n` integers **a1, a2, ..., an**. Each of those integers can be either `0` or `1`. He's allowed to do exactly one move: he chooses two indices `i` and `j` **(1 ≤ i ≤ j ≤ n)** and flips all values `ak` for which their positions are in range `[i, j]` **(that is i ≤ k ≤ j)**. Flip the value of `ak` means to apply operation **ak = 1 - ak**. The goal of the game is that after exactly one move to obtain **the maximum number of ones**. Given a list of `0` or `1`. Return **the maximal number of 1s** that can be obtained after exactly one move.
Lucky Ticket Validator
Given a ticket string consisting of **six digits**, return `YES` if its lucky and `NO` in the opposite case. A ticket is considered lucky if the sum of the first three digits is equal to the sum of the last three digits, even when there are leading zeroes.
Determine the Correct Arithmetic Operator
Given three integers `a`, `b`, and `c`, return `+` if the equation `a + b = c` is true, and `-` if the equation `a - b = c` is true
Modified Sum Calculation
Given a list of integers and a threshold integer, return a sum of numbers, where each number contributes `2` if it exceeds or equals the threshold and `1` otherwise.
Elements Greater Than k
Given an array of integers `nums` and an integer `k`, return an amount of integers in array are larger than the `k`.
Counting Ordered Pairs
Given an integer `n`, return **the number of ordered pairs** of positive integers (a, b) such that `a = n - b`, where both `a` and `b` are positive integers.