-
-
Learning Scala - String
Scala String is the Java String class. String literals are enclosed with double quotes ("). Multi-line string literals are enclosed in triple double quotes: [Read More] -
Learning Scala - Scala Maps
Immutable map: val scores = Map("Alice" -> 10, "Bob" -> 3). [Read More] -
Learning Scala - Scala Set
Set is a collection of distinct elements. By default sets are implemented as hash sets with hashCode method. It’s faster to find elements this way. [Read More] -
Learning Scala - Scala Sequences
Scala’s Seq is an ordered sequence of values. It further breaks into two categories: IndexSeq indicates that reandom access of elements is efficient through index. By default, IndexSeq creates a Vector. LinearSeq implis that the collection can be efficiently split into head and tail. By default, LinearSeq creates a List,... [Read More] -
Learning Scala - Scala Arrays
In Scala, array indices are zero-based. To index in an array, use () instead of [] in Java: [Read More] -
Learning Scala - Scala Collection Basics
Scala’s collection classes begin with the Traversable and Iterable traits, and extend into the three main categories of sequences (Seq), sets (Set), and maps (Map). Sequences further branch off into indexed and linear sequences. [Read More] -
Learning Scala - Case Classes and Pattern Matching in Scala
-
Leetcode 258: Add Digits
Question Question Link [Read More] -
Learning Scala - Object-Oriented Programming in Scala
This article outlines classes, objects, and traits, and Object-Oriented Programming in Scala. [Read More] -
Leetcode 136: Single Number
Question [Read More] -
Leetcode 235: Lowest Common Ancestor of a Binary Search Tree
Question [Read More] -
Leetcode 13: Roman to Integer
Question Given a roman numeral, convert it to an integer. [Read More] -
Leetcode 169: Majority Element
Question Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. [Read More] -
Leetcode 217: Contains Duplicate
Question Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct. [Read More]