0%

题目描述

You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit and position (called “bulls”) and how many digits match the secret number but locate in the wrong position (called “cows”). Your friend will use successive guesses and hints > to eventually derive the secret number.

Write a function to return a hint according to the secret number and > friend’s guess, use A to indicate the bulls and B to indicate the > cows.

Please note that both secret number and friend’s guess may contain duplicate digits.

Read more »

题目描述

Given an array of non-negative integers, you are initially positioned at the first index of the array.

Each element in the array represents your maximum jump length at that position.

Determine if you are able to reach the last index.

Read more »

题目描述

Given an array, rotate the array to the right by k steps, where k is non-negative.

Follow up:

  • Try to come up as many solutions as you can, there are at least 3 different ways to solve this problem.
  • Could you do it in-place with O(1) extra space?
Read more »

题目描述

Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.

Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.

Read more »

题目描述

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.

Read more »

题目描述

Given an array nums and a value val, remove all instances of that value in-place and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
The order of elements can be changed. It doesn’t matter what you leave beyond the new length.

Read more »

C++11 中引入了 std::thread 可以比较方便的创建和管理多线程,这篇笔记主要简单记录了一下我的学习过程。包括线程的创建的管理还有在类中相关的用法。

Read more »

本文是我在学习深蓝学院的激光slam课程关于激光 SLAM 后端优化的内容。本次课主要分成四部分:首先介绍以下基于图优化的的激光 SLAM 的基本概念;然后介绍非线性最小二乘的基本原理;接下来结合前两部分介绍一下非线性最小二乘在 SLAM 中的应用;最后介绍 cartographer 的代码思路作为实践例子。

Read more »