05 2017 档案
摘要:在3D Slicer中,当我们导入.mha/.mhd等格式的volume文件后,那么我们就可以在Axial, Sagittal, Coronal三个方向来观察我们的MRI或者CT的图像了。3D Slicer界面提供了很多交互的功能,比如正上方就有一个滑动条slider,可以用来滑动切片观察,如果我们
阅读全文
摘要:There's a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid. Your goal is to find the minimal distance for the s
阅读全文
摘要:LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But all work and no play makes Jac
阅读全文
摘要:Given an integer n, find the closest integer (not including itself), which is a palindrome. The 'closest' is defined as absolute difference minimized
阅读全文
摘要:Given the coordinates of four points in 2D space, return whether the four points could construct a square. The coordinate (x,y) of a point is represen
阅读全文
摘要:在Python中,处理中文字符一直是很令人头痛的问题,一言不合就乱码,而且引起乱码的原因也不尽相同,有时候是python本身默认的编码器设置的不对,有时候是使用的IDE的解码器不对,还有的时候是终端terminal的解码器不对,有时候同一份代码在Python2上正常运行,Python3上就不行了,反
阅读全文
摘要:Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Exampl
阅读全文
摘要:We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra
阅读全文
摘要:Given a list of strings, you could concatenate these strings together into a loop, where for each string you could choose to reverse it or not. Among
阅读全文
摘要:Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any
阅读全文
摘要:在3D Slicer中,我们如果想在自己写的插件中来修改默认的鼠标响应事件的话,就需要先将原有的响应事件链接删除,然后建立自定义的响应事件链接,然后将自己要实现的功能写在响应事件函数中。 比如Slicer中默认的鼠标左键拖拽,是任意旋转视图中的Camera,默认中的滑轮操作是拉远和拉近视图摄像机,默
阅读全文
摘要:Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array wil
阅读全文
摘要:Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may b
阅读全文
摘要:Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree. Especially, this path can be either increasing or decreas
阅读全文
摘要:二分查找法作为一种常见的查找方法,将原本是线性时间提升到了对数时间范围,大大缩短了搜索时间,具有很大的应用场景,而在 LeetCode 中,要运用二分搜索法来解的题目也有很多,但是实际上二分查找法的查找目标有很多种,而且在细节写法也有一些变化。之前有网友留言希望博主能针对二分查找法的具体写法做个总结
阅读全文
摘要:Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions: where we define that subarray (
阅读全文
摘要:You are given several boxes with different colors represented by different positive numbers. You may experience several rounds to remove boxes until t
阅读全文
摘要:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th
阅读全文
摘要:Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and ri
阅读全文
摘要:Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a
阅读全文
摘要:During the NBA playoffs, we always arrange the rather strong team to play with the rather weak team, like make the rank 1 team play with the rank nth
阅读全文
摘要:Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for every word following rules below. Example: Not
阅读全文
摘要:Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutati
阅读全文
摘要:Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums =
阅读全文
摘要:In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.
阅读全文
摘要:You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int
阅读全文