- Name: Ahmad Ichsan Baihaqi
- E-mail: ahmadichsanbaihaqi@gmail.com
Anagram adalah istilah dimana suatu string yang jika dibolak balik ordernya maka akan sama, eg.: 'aku' dan 'kua' adalah Anagram, 'aku' dan 'aka' bukan Anagram.
Dibawah ini ada array berisi sederetan Strings:
['kita', 'atik', 'tika', 'aku', 'kia', 'makan', 'kua']
Silahkan kelompokkan/group kata - kata di dalamnya sesuai dengan kelompok Anagramnya. Catatan: tidak boleh menggunakan syntax es6 map, sort, reduce, find, filter.
Expected Outputs
[
["kita", "atik", "tika"],
["aku", "kua"],
["makan"],
["kia"]
]
- Language: Javascript
- git clone or download the zip file
- if you choose to download the zip file, once downloaded, extract the zip
- open the program folder with your favorite code editor or you can use terminal without open any code editor
- run the program with this command:
node index.js
- the result will be logged into your terminal
- if you want to change the dataset, you can change it inside file
data.js