Mark Ma's repositories
-Buckets-effect-
As Buckets effect reveals, the capacity of a bucket depends on the shortest board. This is a theory in 3D, an now consider a similar problem in 2D. Given a string of integers, each integer is non-negative, and each integer represents the height of a board which of the width is 1. Compute the capacity of buckets based on Buckets effect.
24point
Given a number N, and N positive integers and a target integer, judge if the N integers can be operated through + - * / ( ) to get the target integer. Input: N Target i1 i2 ... iN Output: True or False Example: Input: 4 32 8 1 6 7 Output: False 55 * 7 + 3 * (6 - 2) - 7 = 390 Input: 6 390 2 6 7 3 55 7 Output: True 1<=N<10, 0 <= Target <= 1000
awesome-se
👨💻 ❤️ 💻 上海交通大学软件学院本科编程作业参考
BASIC-Interpreter
see pdf
calculator
implement a calculator with the help of the textbook("ppp")
concave-or-convax
input the pos of every point, find out whether it is a concave or convex
Cut-the-cake
You want to give your friend a cake, but the shape of the cake you own is too strange. So, you decide to cut the cake based on the following requirements: ⚫ The cake you cut must be rectangular ⚫ You only give your friend one cake, the rest will be thrown away; ⚫ The larger of the cake you cut is, the better. Now, cut the cake and compute the area the cake you cut. In this problem, the cake can be represented by a string of integers. Each integer is non-negative, and each integer represents the height of a cake bar which of the width is 1
datalink
Just try to learn a new data structure map
Encoding-a-text-
问题描述: 给定一个字符数不超过100的英文文本,输出加密版本。 首先,需要将输入标准化,从英语文本中删除空格和标点符。其次,将标准化的字符串分为多行,形成一个矩阵,根据生成的矩阵,获取加密版本。 举个例子,英文文本 This is fun! 被标准化为: thisisfun 明文组织成一个矩形。矩形(a x b)的大小应该试能记录消息长度的最小矩阵,并满足b>=a和b-a<=1,其中b是列的数量,a是行的数量。例子中的标准化明文为9个字符,于是生成一个3×3的矩阵: thi sis fun 按列读取生成的矩阵,得到输出密文: tsf hiu isn 如果标准化明文为空,则输出密文为: Null
Heap-with-map
Implement a Heap based on map
Huffman-Encoding
write a program that allows the user to compress and decompress files using the standard Huffman algorithm for encoding and decoding.
kaggle
kaggle
kaggle-dogs-vs-cats-solution
Kaggle dogs vs cats solution
Leetcode_289
https://leetcode.com/problems/game-of-life/description/
LFU-LRU
Leetcode 460. LFU Cache 146. LRU Cache
magic-square-maker
create magic square in any dimension if it is valid
Matrix-class
a c++ class for matrix calculation
Numbrix-puzzle
https://rosettacode.org/wiki/Solve_a_Numbrix_puzzle?tdsourcetag=s_pctim_aiomsg
overlap_circles
see the pdf
RandomWriter
the random writer is designed to produce somewhat sensible output by generalizing from patterns found in the input text
RedundantParentheses
Requirement Given an expression with redundant parentheses, please output the expression without them with the same relative position. Input (a+(b*c)) ((a/(b/c))/d) (a) Output a+b*c a/(b/c)/d a
reverse-word-in-sentence
turn "fly like a bird" into "bird a like fly"
Scholar-database
read from scholar database
search-for-word
search for the pos of the word in an article, print out the pos, occurrence and its neighbour
spring-boot-microservices-example
Bootiful Microservices with Spring Boot
trie
https://en.wikipedia.org/wiki/Trie
TrumpScript
Make Python great again
wordladder
A word ladder is a connection from one word to another formed by changing one letter at a time with the constraint that at each step the sequence of letters still forms a valid word. For example, here is a word ladder connecting "code" to "data" code -> core -> care -> dare -> date -> data That word ladder, however, is not the shortest possible one. Although the words may be a little less familiar, the following ladder is one step shorter: code -> cade -> cate -> date -> data