This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Accumul.accum("abcd"); // "A-Bb-Ccc-Dddd" | |
// Accumul.accum("RqaEzty"); // "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy" | |
// Accumul.accum("cwAt"); // "C-Ww-Aaa-Tttt" | |
public class Accumul { | |
public String accum(String s) { | |
StringBuilder result = new StringBuilder(); | |
int i = 0; | |
for (char c : s.toCharArray()) { | |
if (i > 0) | |
result.append('-'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createRoot } from 'react-dom/client'; | |
import * as serviceWorker from './service-worker'; | |
const root = createRoot(document.getElementById('root')); | |
root.render(<h1>Hello, world</h1>); | |
serviceWorker.register(); |