GithubHelp home page GithubHelp logo

dawnave's Projects

- icon -

众所周知,Github功能强大,能让所有人在一个实时更新的平台上查看几乎任何东西,以及它们过去的版本和近期的修改。为了方便整理和更新,这里是乱七八糟的设定集

-leetcode-1758-easy-trick icon -leetcode-1758-easy-trick

My solution includes some trick. I used true and false to represent zeros and ones, and a string of bools to represent a bitstring. A quite interesting problem, check my solution for details

867-easy-2d-array icon 867-easy-2d-array

Another easy question, I was wrong yesterday, it is not the postorder today. Although it is listed as easy, but it took me some time to implement the 2d array correctly, go see the second line of the code for the right way to do that. I believe this is not the first time I make this mistake, so It is quite important.

a-parser-for-lisp-with-rdp-and-tdp icon a-parser-for-lisp-with-rdp-and-tdp

It is a parser for Lisp language, I wrote it based on several syntactic categories. Basically, it will check about solid number/lower case letters, and the use of parentheses.

excel-to-plain-text icon excel-to-plain-text

A simple program turning an Excel to objects in python and print out results. This can only work for the specific car program, where the columns of the excel file fits the __init__ part.

finite-automatons icon finite-automatons

Finite Automatons, including NFAs and DFAs. You can build your own FAs based on your rule of an accepting String, for example, ending in "cat". In short, NFAs and DFAs recognize strings that are in a specific pattern.

leetcode-1160-easy- icon leetcode-1160-easy-

A easy problem, I messed up with my i's and j's and ended up wrong several times at first.

leetcode-1207-dictionray icon leetcode-1207-dictionray

Finally, here is an improved way to turn a list into a dictionary. The problem itself is not hard, but if you want to same some code and time, check out the new way^_^

leetcode-1220-hard-dp icon leetcode-1220-hard-dp

Leetcode 1220, a hard DP problem. To me, it is not hard, the patterns behind is quite easy to find if you draw a table. Also, the given hint helped a lot. A bug I encountered is how to initialize the 2D dp table. When using [0,0,0] * n, the sublists are not independent and change in one of them will affect the whole table, so using a for loop is r

leetcode-1347-medium-dictionary icon leetcode-1347-medium-dictionary

A medium question, it took me a while to figure out that I splited two appearance of "c" in the word "practice" in two categories. Overall, it requires some logics, I will consider it as among the medium in the medium problems

leetcode-1356-easy-sort-bit icon leetcode-1356-easy-sort-bit

A easy problem, but it requires some basic knowledge. Easy logics, but hard code for people like me who are not familiar to bits and things like that.

leetcode-1422-easy-brute-force icon leetcode-1422-easy-brute-force

I wasn't thinking about brute force as a solution at first, because that usually stands for a time limit exceeded. However, I found that there probably aren't any tricky and better methods. So here is the brute force solution, simply going through all the possible substrings.

leetcode-1436-easy-loop icon leetcode-1436-easy-loop

Another easy problem. One bug that I encountered is the sequence in the loop. If I do everything inside one loop, I will ignore the cities that appear in the i[0] first, leading to bugs. Interestingly, there seems no way better solutions to this problem, everyone gets pretty much the same complexity.

leetcode-1441-medium-stack-for-loop- icon leetcode-1441-medium-stack-for-loop-

A daily question, using a stream of integers to build an array. Quite easy to be honest, all we need to do is to find the pattern, which is hinted in the hint section. Then, we can use the for loop of a pointer to set up the control flow and achieve the goal.

leetcode-1496-easy-simulation icon leetcode-1496-easy-simulation

A simulation, solved by brute force. I was thinking about using better solutions, but it came out that just simulate the move of the particle is a good idea. Other solutions online are more or less the same.

leetcode-1535-medium-simulation- icon leetcode-1535-medium-simulation-

A leetcode problem. The hint is being kind of misleading. You can pass the first two test cases by simply simulate the game, but it will exceed the time limit in the end. Therefore, some logics are needed. Again, easy coding hard logic

leetcode-1716-easy-math icon leetcode-1716-easy-math

A heavy math problem, lots of adding and multiplication to consider. My solution utilized the index of an array, which is not necessary but worth using.

leetcode-1743-medium-set-dfs icon leetcode-1743-medium-set-dfs

I didn't finish this one, I can't think of a way that takes less then n^2. The solution uses a dictionary, a DFS, and a recursion, and that is a lot for a medium problem. It first uses a dictionary to get the head of the array, and use DFS to get its tail, recursively.

leetcode-1759-medium-math-sliding-window icon leetcode-1759-medium-math-sliding-window

A interesting problem. I followed the hint, using nC2 where n is the length of the continuous substring. There is also a much more elegant sliding window solution. What's funny is, I got the pattern but I forgot how to slide the window, so I missed the better solution. But anyway, using math is still enough to figure out the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.