Skip to content · ⁨Lompat ke konten⁩

Reverse the word order · ⁨Balik urutan kata⁩

English

Reverse the word order

Given a sentence of space-separated words, return the words in reverse order: the quick brown → brown quick the. Split on spaces with s.split(" "), then build the result from the last word to the first. A StringBuilder is the tidy way to join them.

Bahasa Indonesia

Balik urutan kata

Diberikan kalimat dengan kata-kata terpisah spasi, kembalikan kata-kata dalam urutan terbalik: the quick brown → brown quick the. Pisahkan pada spasi dengan s.split(" "), lalu bangun hasil dari kata terakhir ke pertama. Sebuah StringBuilder adalah cara rapi untuk menggabungkan mereka.

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP