lonely

JS遍历对象

江枫思渺然 提交于 2019-12-27 15:24:46
var obj = {}; obj.name = '张三'; obj.age = 19; for(var k in obj) { console.log(k,":",obj[k]); } 来源: CSDN 作者: A_Lonely_Smile 链接: https://blog.csdn.net/A_Lonely_Smile/article/details/103730621

LeetCode 531. Lonely Pixel I

时光总嘲笑我的痴心妄想 提交于 2019-12-05 19:23:05
原题链接在这里: https://leetcode.com/problems/lonely-pixel-i/ 题目: Given a picture consisting of black and white pixels, find the number of black lonely pixels. The picture is represented by a 2D char array consisting of 'B' and 'W', which means black and white pixels respectively. A black lonely pixel is character 'B' that located at a specific position where the same row and same column don't have any other black pixels. Example: Input: [['W', 'W', 'B'], ['W', 'B', 'W'], ['B', 'W', 'W']] Output: 3 Explanation: All the three 'B's are black lonely pixels. Note: The range of width and height of the

Find the lonely integer in an array

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Please refer to this hackerrank challenge if you can. The problem is to find the lonely integer in an array, given an array consists of only pairs except one lonely integer. The problem is with this test case 9 4 9 95 93 57 4 57 93 9 9 is array size and below is the array See the part of code highlighted by //------ If I place scanf("%d", &n) above int arr[n] code works fine, but gives horrible results the other way round. Please help me out #include <stdio.h> int lonely_integer(int* a, int size); int main(){ //n is size of array, i is