Kotlin

How to Reverse Letters in Kotlin

May 13, 2022

The challenge Given a string str, reverse it omitting all non-alphabetic characters.


Read More

How to Get the ASCII Value of Character in Kotlin

May 12, 2022

The challenge Get the ASCII value of a character. The solution in Kotlin Option 1:


Read More

How to use Coroutines in Kotlin

June 17, 2021

Coroutines are a way to handle multithreading in Kotlin, read more about it from the official docs:


Read More

The Pair Type in Kotlin

June 16, 2021

val pair: Pair<String, Int> = "myKey" to 2 What is a Pair Type?


Read More

Deconstruction in Kotlin

June 11, 2021

There are times when you need to extract an object into a number of variables.


Read More

What is a Unit in Kotlin?

June 9, 2021

Unit corresponds to the void keyword in Java. What is a Unit in Kotlin?


Read More

How to declare a Function in Kotlin?

June 8, 2021

Functions are reusable pieces of code, often called Blocks, that as the name suggests, act as building blocks to piece together a program.


Read More

The differences between Val and Var in Kotlin

June 7, 2021

Among all the many keywords that Kotlin comes with, there exists val and var.


Read More

Build a pile of Cubes in Kotlin

March 30, 2021

The challenge Your task is to construct a building which will be a pile of n cubes.


Read More

Which x for that sum in Kotlin

March 29, 2021

The challenge Consider the sequence U(n, x) = x + 2x**2 + 3x**3 + .


Read More

Invert values in Kotlin

March 27, 2021

The challenge Given a set of numbers, return the additive inverse of each.


Read More

Moduli number system in Kotlin

March 25, 2021

The challenge A number system with moduli is defined by a vector of k moduli, [m1,m2, ···,mk].


Read More

Smallest possible sum in Kotlin

March 24, 2021

The challenge Given an array X of positive integers, its elements are to be transformed by running the following operation on them as many times as required:


Read More

Floating-point Approximation in Kotlin

March 23, 2021

The challenge Given a semi-inclusive interval I = [l, u) (l is in interval I but u is not) l and u being floating numbers (0 <= l < u), an integer n (n > 0) a function f: x (float number) -> f(x) (float number) we want to return as a list the n values:


Read More

Multiplication table in Kotlin

March 22, 2021

The challenge Create an NxN multiplication table, of size provided in parameter.


Read More

Strip Comments in Kotlin

March 21, 2021

The challenge Complete the solution so that it strips all text that follows any of a set of comment markers passed in.


Read More

Experimenting with a sequence of complex numbers in Kotlin

March 20, 2021

The challenge Consider the sequence S(n, z) = (1 - z)(z + z**2 + z**3 + .


Read More

Sums of Parts in Kotlin

March 18, 2021

The challenge Let us consider this example (array written in general format):


Read More

Diophantine Equation in Kotlin

March 17, 2021

The challenge In mathematics, a Diophantine equation is a polynomial equation, usually with two or more unknowns, such that only the integer solutions are sought or studied.


Read More