摘要: Given a string s, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward. A substring 阅读全文
posted @ 2021-09-07 16:07 飞翔的菜鸟123 阅读(22) 评论(0) 推荐(0) 编辑
摘要: Why I started this blog – in terms of career development As a software developer, one of the best mediums you can use to market yourself is a blog. It 阅读全文
posted @ 2020-11-19 11:29 飞翔的菜鸟123 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Data type dtype Tensor type 32-bit floating point torch.float32 or torch.float torch.*.FloatTensor 64-bit floating point torch.float64 or torch.double 阅读全文
posted @ 2020-11-01 11:45 飞翔的菜鸟123 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目 class Solution { public: int countBinarySubstrings(string s) { int result = 0; int prev = 0; int current = 1; int n=s.size(); for(int i = 1 ; i < n 阅读全文
posted @ 2020-08-10 19:24 飞翔的菜鸟123 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 二分查找 在闭区间查找[begin,end],注意对找不到的处理 int binary_find(vector<int>& nums, int target){ int l=0,r=nums.size()-1;//Notice while(l<r){ int mid=l+(r-l)>>1; if(n 阅读全文
posted @ 2020-07-29 22:43 飞翔的菜鸟123 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Description 题目 Farmer John has built a new long barn, with N (2 ⇐ N ⇐ 100,000) stalls. The stalls are located along a straight line at positions x1,.. 阅读全文
posted @ 2020-07-29 22:43 飞翔的菜鸟123 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Description Problem 易错点 assuming both players play optimally. Means 你需要保存一个关于N的最佳数组,每轮归谁都会是最佳的 Then Prove N 为奇数的时候 Alice(先手)必败,N 为偶数的时候 Alice 必胜。 1.\( 阅读全文
posted @ 2020-07-24 12:46 飞翔的菜鸟123 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Description Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) Push element x onto stack. pop() 阅读全文
posted @ 2020-05-12 23:38 飞翔的菜鸟123 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Description "Problem" In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you 阅读全文
posted @ 2020-05-06 22:44 飞翔的菜鸟123 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文
posted @ 2020-05-06 18:07 飞翔的菜鸟123 阅读(127) 评论(0) 推荐(0) 编辑