#kotlinDevChallenge – 10
Implement a function that sums the first 5 even numbers from each of three given integer Flows and returns their total sum. Properly handle empty Flows. If a Flow is empty or if all its elements are filtered out, it should contribute 0 to the final sum.
#kotlinDevChallenge – 9
Write a function that takes a list of lists of integers and returns a single list containing all unique elements. Ensure that the resulting list contains only unique elements. For example, given the input [[1, 2, 3], [3, 4, 5], [5, 6]], the function should return [1, 2, 3, 4, 5, 6]. Complete the code […]
#kotlinDevChallenge – 8
data class A is given. We create an instance of this class and then call the .copy() function. What will be printed out? Mark correct answer and submit form.
#kotlinDevChallenge – 7
Write a function that takes a string and returns a modified version where each word is reversed, and additionally, the case of each letter is inverted (uppercase to lowercase and vice versa). Punctuation marks and spaces should remain unchanged. For example, given the string "Hello Kotlin!", the function should return "OLLEh NILTOk!". Complete the code […]
#kotlinDevChallenge – 6
Write a function that takes a string and returns a map where each key is a character and its value is the number of its occurrences in the given string. For example, for the string “kotlin”, the function should return the map: {k=1, o=1, t=1, l=1, i=1, n=1}. Complete the code of the countCharacters function.
#kotlinDevChallenge – 5
Your task today is to implement a toggle mechanism using Kotlin Flow. How should it work? Each time the flow source emits “something” – in this case, Unit – you should emit the negated previous value. For the input: false, flowOf(Unit, Unit) you should create a flow: flowOf(false, true, false) In this snippet, the entire […]
#kotlinDevChallenge – 4
A Coordinates class and an infix extension operator function that operates on these Coordinates are given. Take a good look. Several funny operations can be performed on the vals a and b. What does the function infix operator fun Coordinates.plus allow us to do?
#kotlinDevChallenge – 3
Write a function that takes a natural number and returns its successive digits as a list (e.g., for the number 1234, it returns listOf(1, 2, 3, 4). Input: Long is a natural number – meaning it is non-negative. ps. Again – there are few ways to achieve that 🙂
#kotlinDevChallenge – 2
Second day of our challenge… This time you will face collections. Specifically, a list that has acquired duplicates. We don’t like duplicates. Let’s get rid of them! ps. Again – there are few ways to achieve that 🙂
#kotlinDevChallenge – 1
Your task is to modify the function so that it returns e.x <strong><em><span style="text-decoration: underline;">Kotlin is awesome and so called "birds" fly key</span></em></strong> if the input is birds. Note that the word “birds” is placed in quotation marks. How do you handle such a case with special characters? ps. There are few ways to achieve […]