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
# text = 妳讀進來的字串 | |
# Process the text | |
words = text.lower().split() | |
word_counts = {} | |
character_counts = {char: 0 for char in "abcdefghijklmnopqrstuvwxyz0123456789"} | |
for word in words: | |
# Remove punctuation from words | |
cleaned_word = "".join([char for char in word if char.isalnum()]) |
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
#include <cstring> | |
#include <iostream> | |
using namespace std; | |
int main(void) { | |
int length, i, ans = 0; | |
char string1[61]; | |
char string2[61]; | |
cin.getline(string1, 60); | |
cin.getline(string2, 60); |
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
#include <vector> | |
void mergeSort(std::vector<int>& array); | |
void mergeSortHelper(std::vector<int>& mainArray, std::vector<int>& auxiliaryArray, size_t startIdx, size_t endIdx); | |
void doMerge(std::vector<int>& mainArray, std::vector<int>& auxiliaryArray, size_t startIdx, size_t middleIdx, size_t endIdx); | |
void quickSort(std::vector<int>& array); | |
void quickSortHelper(std::vector<int>& array, std::vector<int>::iterator startIdx, std::vector<int>::iterator endIdx); | |
std::vector<int>::iterator paritition(std::vector<int>& array, std::vector<int>::iterator startIdx, std::vector<int>::iterator endIdx); |