結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2022-12-20 21:40:01 |
言語 | TypeScript (5.7.2) |
結果 |
AC
|
実行時間 | 65 ms / 5,000 ms |
コード長 | 466 bytes |
コンパイル時間 | 8,101 ms |
コンパイル使用メモリ | 229,024 KB |
実行使用メモリ | 39,552 KB |
最終ジャッジ日時 | 2024-12-31 16:48:52 |
合計ジャッジ時間 | 9,858 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
function Main(input: string): void { const [first, second] = input.split('\n').map(str => str.split('')); let result = "YES"; for (const str of first) { if (second.includes(str)) { // firstから1文字ずつ取り出し、secondに含まれればsecondから削除 second.splice(second.indexOf(str), 1); } else { result = "NO"; break; } } console.log(result); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));