Finding Start and End Index of an element in a sorted Array using Kotlin

Finding start and end index of an element in a sorted array using Kotlin programming language will be shown here. The array may contain duplicate elements and we will see how to find a start and end index for an element in this array elements. We may design the algorithm for finding start and end index of an element in…

Hackerrank Solution: 1D Array – Part 2 using Kotlin

This tutorial will show you Hackerrank 1D Array Part 2 using Kotlin. Let’s play a game on an array! You’re standing at index 0 of an n-element array named game. From some index i (where 0 <= i < n), you can perform one of the following moves: Move Backward: If cell i-1 exists and contains a 0, you can…

Validate Email Address with Regular Expression using Kotlin

Introduction This tutorial will show you how to validate email address with regular expression using Kotlin. In this post, email validation in Kotlin will be done using regular expression or regex pattern. In web applications or standalone applications where we need to send emails to intended recipients, it is recommended to check the valid email address before sending email to…

HackerRank Solution: Valid Username Regular Expression using Kotlin

This tutorial will show you how to solve HackerRank Valid Username Checker using Kotlin. In different web applications we define certain rules for choosing the username, such as, it should consists of maximum 30 characters; it should not have any special character; it may contain one or more digits; it must starts with a letter, etc. So here also we…

HackerRank Solution: Tag Content Extractor using Kotlin

This tutorial will shoe you how to solve HackerRank Tag Content Extractor. In a tag-based language like XML or HTML, contents are enclosed between a start tag and an end tag like <tag>contents</tag>. Note that the corresponding end tag starts with a /. Given a string of text in a tag-based language, parse this text and retrieve the contents enclosed…

HackerRank Solution: Subarray using Kotlin

This tutorial will show you how to solve HackerRank Subarray using Kotlin. A subarray of an n-element array is an array composed from a contiguous block of the original array’s elements. For example, if array=[1,2,3], then the subarrays are [1], [2], [3], [1,2], [2,3], and [1,2,3]. Something like [1,3] would not be a subarray as it’s not a contiguous subsection…

Creating Kotlin Project in Eclipse

In this tutorial I will show you how to create Kotlin project in Eclipse. This example shows you how to create Kotlin gradle project or Kotlin maven project. Kotlin is statically typed programming language for modern multiplatform applications. Kotlin has 100% compatibility with Java or vice-versa. Salient Features of Kotlin Drastically reduces the amount of boilerplate code. Avoids entire classes…