classSolution{publicintmajorityElement(int[] nums){Map<Integer,Integer> map =newHashMap<>();for(int i =0; i < nums.length; i++){int last = map.getOrDefault(nums[i],0);int now = last +1;if(now > nums.length /2){return nums[i];}
map.put(nums[i], now);}return-1;}}
初探Spring Boot实战概述
Spring Boot简介
Spring Boot是一个开源的Java框架,由Pivotal团队(现为VMware的一部分)开发,旨在简化Spring应用程序的创建和部署过程。它通过提供一系列自动化配置、独立运行的特性和微服务支持&#…