pokerpoke / leetcode Goto Github PK
View Code? Open in Web Editor NEWDebug LeetCode C/C++ problems locally.
Debug LeetCode C/C++ problems locally.
求问这是咋回事儿呀,没有找到gtest_discover_tests在哪儿,这一句是干嘛的呀
CMake Error at src/CMakeLists.txt:14 (gtest_discover_tests):
Unknown CMake command "gtest_discover_tests".
-- Configuring incomplete, errors occurred!
See also "/home/ciruelas/code/repos/LeetCode/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciruelas/code/repos/LeetCode/build/CMakeFiles/CMakeError.log".
./leetcode: line 30: ./findDuplicate: No such file or directory
在最新的版本e40c3da
listnode.h文件的第28行:
ListNode(int x = 0, ListNode *p = nullptr) : val(x), next(nullptr){};
应该改成
ListNode(int x = 0, ListNode *p = nullptr) : val(x), next(p){};
您好,我在使用这个repo做链表题目的时候 leetcode problem 207
发现会出现 free(): double free detected in tcache 2
报错。我在代码里看到这样一段:
// 是否删除链表
// 某些题目中会使用两个链表,删除两次会出错
// 开启后会造成内存泄漏
void setRelease(bool release = true);
我试着用 valgrind 定位这个问题,发现如果 release = true
, 则会多出 4 个 free
过程。而这个问题仅在测例为如下情况时才出现:
TEST(remove_linked_list_elements, remove_linked_list_elements_case3)
{
Solution s;
List in = {7, 7, 7, 7};
List ans = {};
int val = 7;
// in.no_release();
// ans.no_release();
EXPECT_TRUE(is_same_list(s.removeElements(in.head, val), ans.head));
}
请问您是如何定位这个问题,并通过这种方式解决 double free 的?我尝试了一个晚上,没有丝毫头绪,希望得到您的回复!十分感谢!
TODO List
I'm looking for a local solution/test generator for LeetCode, and fortunately I found it! Thanks for your work.
看起来不支持二维数组,不同类型的vector的输入,有计划支持吗。
我的意思是,对于这种输入 [["#",".","#"]]
可以生成对应的vector<vector> 。
以及,此插件对于树和链表的打印似乎也没有。
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.