qubenhao / leetcode Goto Github PK
View Code? Open in Web Editor NEWAlgorithms I wrote in LeetCode
Algorithms I wrote in LeetCode
代码
class Solution {
TreeNode head = new TreeNode(-1);
TreeNode pre = head;
public TreeNode increasingBST(TreeNode root) {
inorder(root);
return head.right;
}
public void inorder(TreeNode node) {
if (node == null) {
return;
}
inorder(node.left);
pre.left = null;
pre.right = node;
pre = node;
inorder(node.right);
}
}
Automatically complete solve function based on question type?
better handling of user code with comments?
golang 1656 test not pass, because:
Error: Not equal:
expected: []interface {}{interface {}(nil), []interface {}{}, []interface {}{"aaaaa"}, []interface {}{"bbbbb", "ccccc"}, []interface {}{}, []interface {}{"ddddd", "eeeee"}}
actual : []interface {}{interface {}(nil), []string(nil), []string{"aaaaa"}, []string{"bbbbb", "ccccc"}, []string(nil), []string{"ddddd", "eeeee"}}
Also:
Originally posted by @QuBenhao in #22 (comment)
Problems that modify inputs directly should return test_input instead of output of function which is None?
Need a better process when getting such problems.
Language C basic support
Implement and Handle special cases:
Some problems the output is not consistent. Better handling for random test?
Java basic support
Fix solve function
Problem like 382 has class Solution being init, fix this in process problem?
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def __init__(self, head: Optional[ListNode]):
def getRandom(self) -> int:
# Your Solution object will be instantiated and called as such:
# obj = Solution(head)
# param_1 = obj.getRandom()
language ts basic support
Fix compare combinations list?
Originally posted by @QuBenhao in #21 (comment)
The markdown is not readable in Pycharm
Timeout function for infinite loop
and better find out Memory cost?
Considering support for other languages than python? E.g. Golang, Java, C and so on
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.