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
# print the list of all files in the leetcode directory | |
import os | |
import pathlib | |
import glob | |
import itertools | |
files = pathlib.Path("leetcode") | |
file_ext = ['cpp', 'py', 'postgresql'] | |
new_folder = './leetcode-solutions' |
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 <bits/stdc++.h> | |
using namespace std; | |
// function used to convert the given string of size 'n' into | |
// the auxiliary string of size '2n+1' | |
string convert(string str) | |
{ | |
string nw = "#"; | |
for (int i = 0; i < str.size(); ++i) { | |
nw += str.substr(i, 1) + "#"; |