自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

bitcarmanlee的博客

https://github.com/bitcarmanlee/easy-algorithm-interview-and-practice 同步更新,欢迎star

  • 博客(8)
  • 收藏
  • 关注

原创 回文字符串,回文链表

leetcode中有一些与回文相关的题,下面我们来看几道。1.判断字符串是否回文串判断一个字符串是不是回文串,只需要使用双指针的方式,从字符串两端向中间靠拢即可。public class Huiwen { public static boolean huiwenStr(String s) { if (s == null || s.length() == 0) { return true; } int i=0, j=s.

2021-02-28 10:37:44 284 2

原创 leetcode 877 stone game

1.问题描述Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].The objective of the game is to end with the most stones. The total number of stone

2021-02-25 20:03:14 191

原创 leetcode319 Bulb Switcher

1.问题描述There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it’s off or turning off if it’s on). For the nth round, you only toggle t

2021-02-24 17:00:23 181

原创 leetcode 292 NimGame

1.问题描述You are playing the following Nim Game with your friend:There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones.The one who removes the last stone will be the winner.You will take the first turn to remove the

2021-02-24 15:41:56 170

原创 hadoop hdfs文件给其他账号授权

1.文件账号授权需求hdfs上的目录与文件对应各自的kerberos账号,很多时候需要对另外的账号授予权限。这个时候可以使用setfacl命令来完成相应的需求。2.getfacl命令在了解setfacl之前,我们先看看getfacl命令。hadoop fs -getfacl filepath# file: filepath# owner: xxx# group: supergroupuser::rwxgroup::rwxmask::rwxother::rwx可以看到,此时file

2021-02-22 16:25:14 4026

原创 ip地址与整数的相互转化

1.为什么需要将ip转化为整数对于ipv4的ip地址,如果使用字符串存储,占用的空间比较大。比如0.1.2.3这个字符串,需要的是7个字节。而对于255.255.255.255这个字符串,需要的是15个字节。整体看来,存储一个ip地址需要7-15个字节。那么实际使用过程中有没有更好的方式存储,从而节省存储空间?答案是肯定的。ipv4本质是32为的二进制字符串,一个int的整数刚好是4个字节32位,所以一个int类型的整数刚好可以表示一个ipv4地址。因此,我们使用4个字节的int类型数字来表示一个ip

2021-02-04 19:42:53 4241 1

原创 spark 窗口函数(Window)实战详解

项目github地址:bitcarmanlee easy-algorithm-interview-and-practice欢迎大家star,留言,一起学习进步1.为什么需要窗口函数在1.4以前,Spark SQL支持两种类型的函数用来计算单个的返回值。第一种是内置函数或者UDF函数,他们将单个行中的值作为输入,并且他们为每个输入行生成单个返回值。另外一种是聚合函数,典型的是SUM, MAX, AVG这种,是对一组行数据进行操作,并且为每个组计算一个返回值。上面提到的两种函数,实际当中使用非常广泛,但

2021-02-03 20:20:52 8983 1

原创 git查看某次提交的内容

git上如果想查看某次commit的内容,按如下操作即可1.获取该次的commit idgit log2.查看该次commit的具体内容git show xxxid

2021-02-02 15:43:57 6166 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除