def cinema_auditorium (x,row): return x[row].count(1)
const cinema_auditorium = (spisok2D,ryad)=> {console.log(spisok2D,ryad)return 3- def cinema_auditorium (x,row):
- return x[row].count(1)
}
x=[ [1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 1, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 1, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1] ] import codewars_test as test @test.describe("Fixed Tests") def fixed_tests(): @test.it('Basic Test Cases') def basic_test_cases(): test.assert_equals(cinema_auditorium (x,0), 3); test.assert_equals(cinema_auditorium (x,2), 0); test.assert_equals(cinema_auditorium (x,4), 3); test.assert_equals(cinema_auditorium ([[0,1],[1,0]],0), 1);
// Since Node 10, we're using Mocha.// You can use `chai` for assertions.const chai = require("chai");const assert = chai.assert;// Uncomment the following line to disable truncating failure messages for deep equals, do:// chai.config.truncateThreshold = 0;// Since Node 12, we no longer include assertions from our deprecated custom test framework by default.// Uncomment the following to use the old assertions:// const Test = require("@codewars/test-compat");let x=[- x=[
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 1],
- [1, 0, 1, 1, 0, 1, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [1, 1, 0, 0, 0, 0, 0, 0, 0, 1],
- [0, 0, 0, 0, 1, 1, 0, 1, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
- [0, 0, 0, 1, 0, 0, 1, 0, 1, 0],
- [0, 0, 0, 0, 0, 1, 1, 0, 1, 0],
- [0, 0, 0, 0, 0, 0, 0, 1, 0, 1]
- ]
describe("Solution", function() {it("should test for something", function() {// Test.assertEquals(1 + 1, 2);assert.strictEqual(cinema_auditorium (x,0), 3);assert.strictEqual(cinema_auditorium (x,2), 0);});});//assert.strictEqual(cinema_auditorium(), 100, "value of a+b is not equal to 100");- import codewars_test as test
- @test.describe("Fixed Tests")
- def fixed_tests():
- @test.it('Basic Test Cases')
- def basic_test_cases():
- test.assert_equals(cinema_auditorium (x,0), 3);
- test.assert_equals(cinema_auditorium (x,2), 0);
- test.assert_equals(cinema_auditorium (x,4), 3);
- test.assert_equals(cinema_auditorium ([[0,1],[1,0]],0), 1);