매주 도전081
this week's
작업 #1 › 공통 기본 문자열
일부 CPAN 모듈은 이를 할 수 있지만, 나는 TWC에서 CPAN 모듈을 사용하지 않는다. List::Util (Perl core에서) 을 제외하고는.
이 임무를 완수하기 위해서 나는 한 번에 알파벳을 순환한다.만약 기초 문자열이 전체 문자열과 일치하도록 한 번 또는 여러 번 반복된다면, 이 문자열은 두 문자열의 기초 문자열로 간주될 수 있다.
예.
» ./ch-1.pl abcdabcd abcdabcdabcdabcd
abcd abcdabcd
» ./ch-1.pl aaa aa
a
작업 #2 › 주파수 정렬
이 작업은 다음 단계로 나눌 수 있습니다.
\s+
로 구분)를 주파수 산열에 넣는다.예.
» ./ch-2.pl input.txt
1 But City It Jet Juliet Latino New Romeo Side Story Their Then West York adaptation any anything at award-winning away become before begin best classic climactic coexist control dance do doesn't end ending escalates families feuding form former friend gains gangs goes happened hatred heartbreaking highway hoping in know love lovers meet meeting neither no one plan planning point romantic rumble run secret sends sister streets strikes terribly their two under understanding until violence warring what when where white whoever wins with wrong younger
2 Bernardo Jets Riff Sharks The by it led tragedy
3 Maria Tony a can of stop
4 to
9 and the
Reference
이 문제에 관하여(매주 도전081), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/simongreennet/the-weekly-challenge-081-1jje텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)