about | help | code help+videos | done | prefs |
Given a string of any length, return a new string where the last 2 chars, if present, are swapped, so "coding" yields "codign". lastTwo("coding") → "codign" lastTwo("cat") → "cta" lastTwo("ab") → "ba" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 172.0
Copyright Nick Parlante 2017 - privacy